package com.hsnn.medstgmini.pro.base.model;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.hsnn.medstgmini.base.dict.model.DicArea;
import com.hsnn.medstgmini.base.std.model.HospInfo;
import com.hsnn.medstgmini.base.std.model.StdCompinfo;


/**
 *@category 配送企业目录查看 实体类
 * @author 韩守松
 * @date 2015年6月15日
 */
@Entity
@Table(name="base_delrelation")

public class BaseDelrelation  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = -4884925448258384975L;
	private String delRelId;//配送关系Id
     private String goodsCode;//商品ID
     private String prodCompId;//生产企业id
     private String areaCode;//地区编码
     private String delCompId;//配送企业id
     private String hospId;//医疗机构id
     private Short status;//状态0未确认1已确认2拒绝
     private Timestamp updDatetime;//更新时间
     private String updUser;//更新人
     private String delCompCode;
     private String delRange;
     
    public String getDelRange() {
		return delRange;
	}

	public void setDelRange(String delRange) {
		this.delRange = delRange;
	}

	// private BaseGoods baseGoods;//商品实体类
     @Transient
     public String getDelCompCode() {
		return delCompCode;
	}

	public void setDelCompCode(String delCompCode) {
		this.delCompCode = delCompCode;
	}

	private StdCompinfo stdCompinfo;//生产企业实体类
     
     private DicArea dicArea;//地区编码实体类
     
     private StdCompinfo stdPSCompinfo;//配送企业实体类
     
     private HospInfo hospInfo;//医疗机构实体类
     
    
    @OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    @JoinColumn(name="prod_comp_id")
    public StdCompinfo getStdCompinfo() {
		return stdCompinfo;
	}

	public void setStdCompinfo(StdCompinfo stdCompinfo) {
		this.stdCompinfo = stdCompinfo;
	}
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    @JoinColumn(name="area_code")
	public DicArea getDicArea() {
		return dicArea;
	}

	public void setDicArea(DicArea dicArea) {
		this.dicArea = dicArea;
	}
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    @JoinColumn(name="del_comp_id")
	public StdCompinfo getStdPSCompinfo() {
		return stdPSCompinfo;
	}

	public void setStdPSCompinfo(StdCompinfo stdPSCompinfo) {
		this.stdPSCompinfo = stdPSCompinfo;
	}
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    @JoinColumn(name="hosp_id")
	public HospInfo getHospInfo() {
		return hospInfo;
	}

	public void setHospInfo(HospInfo hospInfo) {
		this.hospInfo = hospInfo;
	}

	/*@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    @JoinColumn(name="drug_id")
	public BaseGoods getBaseGoods() {
		return baseGoods;
	}

	public void setBaseGoods(BaseGoods baseGoods) {
		this.baseGoods = baseGoods;
	}*/

	/** default constructor */
    public BaseDelrelation() {
    }

	/** minimal constructor */
    public BaseDelrelation(String delRelId) {
        this.delRelId = delRelId;
    }
    
    /** full constructor */
    public BaseDelrelation(String delRelId, String drugId, String prodCompId, String areaCode, String delCompId, String hospId, Short status, Timestamp updDatetime, String updUser) {
        this.delRelId = delRelId;
        this.goodsCode = drugId;
        this.prodCompId = prodCompId;
        this.areaCode = areaCode;
        this.delCompId = delCompId;
        this.hospId = hospId;
        this.status = status;
        this.updDatetime = updDatetime;
        this.updUser = updUser;
    }

   
    // Property accessors
    @Id 
    @Column(name="del_rel_id", unique=true, nullable=false, length=36)

    public String getDelRelId() {
        return this.delRelId;
    }
    
    public void setDelRelId(String delRelId) {
        this.delRelId = delRelId;
    }
    
    @Column(name="goods_code" ,length=36)
    public String getGoodsCode() {
        return this.goodsCode;
    }
    
    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }
    
    @Column(name="prod_comp_id",insertable=false, updatable=false, length=36)

    public String getProdCompId() {
        return this.prodCompId;
    }
    
    public void setProdCompId(String prodCompId) {
        this.prodCompId = prodCompId;
    }
    
    @Column(name="area_code",insertable=false, updatable=false, length=10)

    public String getAreaCode() {
        return this.areaCode;
    }
    
    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }
    
    @Column(name="del_comp_id", insertable=false, updatable=false,length=36)

    public String getDelCompId() {
        return this.delCompId;
    }
    
    public void setDelCompId(String delCompId) {
        this.delCompId = delCompId;
    }
    
    @Column(name="hosp_id",insertable=false, updatable=false, length=36)

    public String getHospId() {
        return this.hospId;
    }
    
    public void setHospId(String hospId) {
        this.hospId = hospId;
    }
    
    @Column(name="status")

    public Short getStatus() {
        return this.status;
    }
    
    public void setStatus(Short status) {
        this.status = status;
    }
    
    @Column(name="upd_datetime", length=19)

    public Timestamp getUpdDatetime() {
        return this.updDatetime;
    }
    
    public void setUpdDatetime(Timestamp updDatetime) {
        this.updDatetime = updDatetime;
    }
    
    @Column(name="upd_user", length=36)

    public String getUpdUser() {
        return this.updUser;
    }
    
    public void setUpdUser(String updUser) {
        this.updUser = updUser;
    }
   








}